package com.learning.cache.redis.snowslide;


import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * @author Shaom
 */
@Repository
public class DataDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public String get(String name) {
        String sql = "SELECT a.* FROM lotso_web.t_sys_user a where a.username = '" + name + "'";

        Map<String, Object> map = jdbcTemplate.queryForMap(sql);

        return JSON.toJSONString(map);

    }


}